from calc import count
import unittest
c = count(1,2)
print(c.add())

# 用例必须以test开头

class TestCount(unittest.TestCase):
    def setUp(self):
        print("before")
    def tearDown(self):
        print("after")

    # 测试加法，这些都是成员函数，要有self参数
    def test_add(self):
        c = count(1,3)
        ret = c.add()
        self.assertEqual(ret,4)

    def test_sub(self):
        c = count(1,3)
        ret = c.sub()
        self.assertEqual(ret,-2)
    def aaaa(self):
        print("hello world")

if __name__=='__main__':
    unittest.main()
